<template>
	<view>
		<u-avatar :src="img" mode="square" size="100">
		</u-avatar>
		<!-- <u-grid :col="3">
			<u-grid-item v-for="item in gird">
				<u-icon name="photo" :size="46"></u-icon>
				<view class="grid-text" @click="redirect(item.url)">{{item.girdName}}</view>
			</u-grid-item>
		</u-grid> -->



		<u-grid :col="3" align="centen">
			<u-grid-item>
				<u-icon name="order" :size="46"></u-icon>
				<navigator url="../internship/internshipList">
					<view class="grid-text">实习单位列表</view>
				</navigator>
			</u-grid-item>
			<u-grid-item>
				<u-badge count="9" :offset="[30, 30]"></u-badge>
				<u-icon name="volume-up" :size="46"></u-icon>
				<view class="grid-text">公告</view>
			</u-grid-item>
			<u-grid-item>
				<u-icon name="eye" :size="46"></u-icon>
				<navigator url="../teacher/teacherDetails">
					<view class="grid-text">实习指导老师</view>
				</navigator>
			</u-grid-item>
			<u-grid-item>
				<u-icon name="edit-pen-fill" :size="46"></u-icon>
				<navigator url="../evaluate/evaluate">
					<view class="grid-text">评价</view>
				</navigator>
			</u-grid-item>
			<u-grid-item>
				<image src="/static/image/icon/hot5.png" class="badge-icon"></image>
				<u-icon name="file-text" :size="46"></u-icon>
				<view class="grid-text">实习鉴定表</view>
			</u-grid-item>
			<u-grid-item>
				<u-icon name="file-text-fill" :size="46"></u-icon>
				<view class="grid-text">单位接收函</view>
			</u-grid-item>
			<u-grid-item>
				<u-icon name="edit-pen" :size="46"></u-icon>
				<view class="grid-text">请假</view>
			</u-grid-item>

			<u-grid-item>
				<u-icon name="edit-pen" :size="46"></u-icon>
				<navigator url="../chat/index">
					<view class="grid-text">test聊天</view>
				</navigator>
			</u-grid-item>
		</u-grid>


	</view>
</template>

<script>
	export default {
		data() {
			return {
				img: "",
				gird: [{
					girdName: "图片",
					url: "/pages/internship/internshipList"
				}, {
					girdName: "图片",
					url: "/pages/internship/internshipList"
				}, {
					girdName: "图片",
					url: "/pages/internship/internshipList"
				}, {
					girdName: "图片",
					url: "/pages/internship/internshipList"
				}, ]
			}
		},
		created() {
			this.getUserInfo()
		},
		methods: {
			async getUserInfo() {
				let token = uni.getStorageSync('token')
				const res = await this.$myRequest({
					url: '/intern/user/info',
					method: 'get',
					token: token
				})
				console.log(res.data)
				this.img = res.data.data.avatar
			},
			redirect(url) {
				uni.redirectTo({
					url: url
				})
			}
		}
	}
</script>

<style lang="scss">
	.badge-icon {
		position: absolute;
		top: 14rpx;
		right: 40rpx;
		width: 30rpx;
		height: 30rpx;
	}

	.grid-text {
		font-size: 28rpx;
		margin-top: 4rpx;
		color: $u-type-info;
	}
</style>
